figure;hold on
for mouse_id = 1:5
    for session = 1:6
        max_act(mouse_id,session) = max(-vel_a{mouse_id,session});
        max_pas(mouse_id,session) = max(-vel_p{mouse_id,session});
    end
    plot(max_act(mouse_id,:))
    plot(max_pas(mouse_id,:),'r')
end
figure;hold on
errorbar(mean(max_act),std(max_act)/sqrt(5))
errorbar(mean(max_pas),std(max_pas)/sqrt(5),'r')



figure;hold on
for mouse_id = 1:5
    for session = 1:6
        mean_act(mouse_id,session) = mean(-vel_a{mouse_id,session});
        mean_pas(mouse_id,session) = mean(-vel_p{mouse_id,session});
    end
    plot(mean_act(mouse_id,:))
    plot(mean_pas(mouse_id,:),'r')
end
figure;hold on
errorbar(mean(mean_act),std(mean_act)/sqrt(5))
errorbar(mean(mean_pas),std(mean_pas)/sqrt(5),'r')


figure;hold on
for mouse_id = 1:5
    for session = 1:6
        bi_act = -vel_a{mouse_id,session};
        bi_act(bi_act > 0.005) = 1;
        bi_act(bi_act <= 0.005) = 0;
        run_time_act(mouse_id,session) = sum(bi_act)/length(bi_act)*100;
        
        bi_pas = -vel_p{mouse_id,session};
        bi_pas(bi_pas > 0.005) = 1;
        bi_pas(bi_pas <= 0.005) = 0;
        run_time_pas(mouse_id,session) = sum(bi_pas)/length(bi_pas)*100;
    end
    plot(run_time_act(mouse_id,:))
    plot(run_time_pas(mouse_id,:),'r')
end
figure;hold on
errorbar(mean(run_time_act),std(run_time_act)/sqrt(5))
errorbar(mean(run_time_pas),std(run_time_pas)/sqrt(5),'r')